package com.echo.code.spring.springbootdemo.core;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/27
 */
@Repository
@Slf4j
public class PersonDao {

  @PostConstruct
  public void initDataSource() {
    log.info("init datasource...");
  }

  public void addPerson(Person person) {
    log.info("add one person: {}", person);
  }

  @PreDestroy
  public void destroy() {
    log.info("close datasource...");
  }
}
